package com.dao;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.po.IndustryNewsInfoPO;
@Repository
public class Industry_NewsDao {
	@Autowired
	private SqlSessionTemplate sqlTemplate;
	
	/**
	 * 查找行业动态信息
	 * @return
	 */
	public List<IndustryNewsInfoPO> findNewsInfo() {
		return sqlTemplate.selectList("news.findNewsInfo");
	}
	/**
	 * 保存行业信息
	 * @param newsPO
	 * @return 
	 */
	public int saveInfo(IndustryNewsInfoPO newsPO) {
		return sqlTemplate.insert("news.saveInfo",newsPO);
	}
	/**
	 * 保存详细的行业信息外键在行业信息表中
	 * @param id
	 */
	public void saveNewsFid(int id) {
		sqlTemplate.update("news.saveNewsFid",id);
	}
	
	
	
	
	/**
	 * 修改行业新闻信息
	 * @param newsPO
	 */
	public void updateNewsInfo(IndustryNewsInfoPO newsPO) {
		sqlTemplate.update("news.updateNewsInfo", newsPO);
	}
	/**
	 * 根据ID,查找行业新闻信息
	 * @param id
	 * @return
	 */
	public IndustryNewsInfoPO findNewsInfoById(String id) {
		return sqlTemplate.selectOne("news.findNewsInfoById", id);
	}
	/**
	 * 根据ID，删除行业新闻信息
	 * @param id
	 */
	public void deleteNewsInfoById(String id) {
		sqlTemplate.delete("news.deleteNewsInfoById", id);
	}
	
	
	
	
	
	
	
}
